﻿using System;
using System.Net;

using PowerArrow.nasa.Model;
using SilverlightCairngorm.Control;
using SilverlightCairngorm.Command;
using PowerArrow.nasa.Control;

namespace PowerArrow.nasa.Command
{
    public class ArrCommand : ICommand
    {
        private PowerArrowModel model = null;

        #region ICommand Members

        public void execute(CairngormEvent cairngormEvent)
        {
            model = PowerArrowModel.Instance;
            switch (cairngormEvent.Name)
            {
                case PowerArrowController.ARR_EVENT_GENERAL:
                    model.ArrStatus = ArrowViewStatus.General.ToString();
                    break;
                case PowerArrowController.ARR_EVENT_ONREADY:
                    model.ArrStatus = ArrowViewStatus.OnReady.ToString();
                    model.ShowArrow = true;
                    model.OnFire = false;
                    break;
                case PowerArrowController.ARR_EVENT_ONFIRE:
                    model.OnFire = true;
                    break;
                case PowerArrowController.ARR_EVENT_OFFFIRE:
                    model.ShowArrow = true;
                    model.OnFire = false;
                    break;
            }
        }

        #endregion
    }
}
